<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumesRelateStepCategoryProcessedPeopleInTaskWorkOrderTable extends AbstractMigration
{
    public function up()
    {
        $this->table('task_work_order')
            ->addColumn('close_at', 'integer', ['signed' => false, 'null' => false, 'default' => 0, 'limit' => 11, 'comment' => '关闭时间'])
            ->addColumn('relate_step_category_id', 'integer', ['signed' => false, 'null' => false, 'default' => 0, 'limit' => 11, 'comment' => '关联环节id'])
            ->addColumn('processed_people', 'string', ['null' => false, 'default' => '', 'limit' => 128, 'comment' => '处理人员'])
            ->addColumn('treatment', 'string', ['null' => false, 'default' => '', 'limit' => 128, 'comment' => '处理方法'])
            ->addColumn('incidence', 'string', ['null' => false, 'default' => '', 'limit' => 128, 'comment' => '影响范围'])
            ->save();
    }

    public function down()
    {
        $this->table('task_work_order')
            ->removeColumn('close_at')
            ->removeColumn('relate_step_category_id')
            ->removeColumn('processed_people')
            ->removeColumn('treatment')
            ->removeColumn('incidence')
            ->save();
    }
}
